package com.tliaswebmanagement.config;

import com.tliaswebmanagement.interceptor.LoginCheckInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//配置类
//@Configuration
public class WebConfig implements WebMvcConfigurer {

    //拦截器要拦截的路径和执行的方法
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginCheckInterceptor()).addPathPatterns("/**").excludePathPatterns("/login");
    }
}
